If any text is selected when you type from the keyboard or Paste,
the selected text is first deleted before the new text is entered.
This is a handy way to replace text.
To replace a range of text
Select the range of text to replace.
Type the replacement text from the
keyboard or Paste the replacement text from the clipboard.
The text that was originally selected
is deleted before the new text is added.